package cn.edu.hunau.java.week03.day01;

import org.junit.Test;

public class RegexTest {
    @Test
    public void test01(){
        match("400112","[0-9]{6}");
        match("4001120","[0-9]{6}");
        match("13412341234","1[3-9][0-9]{9}");
        match("12412341234","1[3-9][0-9]{9}");
        String s1="abc   ads sa sdfa   ".replaceAll("\\s+","");
        System.out.println(s1);
    }
    @Test
    public <sidRegex> void test02(){
        String sidRegex="^\\d{12}$";
        String idRegex="^\\d{17}[0-9Xx]$";
    }
    public void match(String value,String regex){
        System.out.println("正则:"+regex+",匹配值:"+value+",结果"+value.matches(regex));
    }
}
